<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="软件园商城 - 用户管理系统">
    <meta name="author" content="">
    <title>货物管理 | 软件园商城</title>
    <!-- Bootstrap core CSS -->
    <link href="css/bootstrap.min.css" rel="stylesheet" th:href="@{/css/bootstrap.min.css}">
    <!-- Font Awesome -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css">
    <!-- Custom styles -->
    <link href="css/dashboard.css" rel="stylesheet" th:href="@{/css/dashboard.css}">
    <style type="text/css">
        :root {
            --primary-color: #4e73df;
            --secondary-color: #f8f9fc;
            --accent-color: #2e59d9;
            --text-color: #5a5c69;
            --error-color: #e74a3b;
            --success-color: #1cc88a;
            --info-color: #36b9cc;
            --warning-color: #f6c23e;
        }

        body {
            background-color: #f8f9fc;
            color: var(--text-color);
            font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
        }

        .card {
            border: none;
            border-radius: 0.35rem;
            box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
            margin-bottom: 1.5rem;
        }

        .card-header {
            background-color: var(--primary-color);
            color: white;
            border-bottom: none;
            padding: 1rem 1.35rem;
            border-radius: 0.35rem 0.35rem 0 0 !important;
        }

        .table-responsive {
            padding: 0;
        }

        .table {
            margin-bottom: 0;
            width: 100%;
        }

        .table thead th {
            border-bottom: 2px solid #e3e6f0;
            color: #6c757d;
            font-weight: 600;
            text-transform: uppercase;
            font-size: 0.75rem;
            letter-spacing: 0.05em;
            padding: 1rem;
        }

        .table td {
            padding: 1rem;
            vertical-align: middle;
            border-top: 1px solid #e3e6f0;
        }

        .table-striped tbody tr:nth-of-type(odd) {
            background-color: rgba(0, 0, 0, 0.02);
        }

        .table-hover tbody tr:hover {
            background-color: rgba(78, 115, 223, 0.05);
        }

        .action-btn {
            padding: 0.375rem 0.75rem;
            font-size: 0.875rem;
            border-radius: 0.2rem;
            margin-right: 0.25rem;
            transition: all 0.2s;
        }

        .action-btn:hover {
            transform: translateY(-1px);
            box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
        }

        .btn-view {
            background-color: var(--info-color);
            border-color: var(--info-color);
        }

        .btn-edit {
            background-color: var(--warning-color);
            border-color: var(--warning-color);
        }

        .btn-delete {
            background-color: var(--error-color);
            border-color: var(--error-color);
        }

        .search-form {
            background: white;
            padding: 1.5rem;
            border-radius: 0.35rem;
            box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.1);
            margin-bottom: 1.5rem;
        }

        .form-group {
            margin-bottom: 1rem;
        }

        .form-control {
            padding: 0.75rem 1rem;
            border: 1px solid #d1d3e2;
            border-radius: 0.35rem;
            transition: border-color 0.3s ease;
        }

        .form-control:focus {
            border-color: var(--primary-color);
            box-shadow: 0 0 0 0.2rem rgba(78, 115, 223, 0.25);
        }

        .btn-search {
            background-color: var(--primary-color);
            border-color: var(--primary-color);
            padding: 0.75rem 1.5rem;
            font-weight: 600;
        }

        .btn-add {
            background-color: var(--success-color);
            border-color: var(--success-color);
            padding: 0.5rem 1rem;
            font-weight: 600;
        }

        .alert-message {
            padding: 0.75rem 1.25rem;
            border-radius: 0.35rem;
            margin-bottom: 1rem;
            background-color: #f8d7da;
            border-color: #f5c6cb;
            color: #721c24;
        }

        .page-title {
            font-weight: 600;
            color: var(--primary-color);
            margin-bottom: 1.5rem;
            display: flex;
            align-items: center;
        }

        .page-title i {
            margin-right: 0.75rem;
            font-size: 1.5rem;
        }

        /* Animation */
        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(10px); }
            to { opacity: 1; transform: translateY(0); }
        }

        .animated-content {
            animation: fadeIn 0.5s ease-out;
        }

        /* Responsive adjustments */
        @media (max-width: 768px) {
            .table-responsive {
                padding: 0;
            }

            .action-btn {
                margin-bottom: 0.25rem;
                display: block;
                width: 100%;
            }
        }
    </style>
</head>

<body>
<div th:replace="muen :: headmeun"></div>

<div class="container-fluid">
    <div class="row">
        <div th:replace="muen :: #sidebarMenu(lurl='shoptrue')"></div>

        <main role="main" class="col-md-9 ml-sm-auto col-lg-10 pt-3 px-4 animated-content">
            <div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pb-3 mb-4 border-bottom">
                <h1 class="page-title">
                    <i class="fas fa-users-cog"></i>商品搜索
                </h1>
                <div class="btn-toolbar mb-2 mb-md-0">
                    <a class="btn btn-add text-white" href="#" th:href="@{/showAddShopPage}">
                        <i class="fas fa-user-plus mr-1"></i>新增货物
                    </a>
                </div>
            </div>

            <div th:if="${msg!=null and msg!=''}" class="alert-message" th:text="${msg}"></div>

            <div class="search-form">
                <form action="/shopFindByTypeContaining" method="post">
                    <div class="row">
                        <div class="col-md-4">
                            <div class="form-group">
                                <label>货物名称:</label>
                                <input type="text" class="form-control" name="type" placeholder="输入货物名称">
                            </div>
                        </div>
                    </div>
                    <div class="text-right">
                        <button type="submit" class="btn btn-search text-white">
                            <i class="fas fa-search mr-1"></i>模糊搜索
                        </button>
                    </div>
                </form>
            </div>

            <div class="card shadow mb-4">
                <div class="card-header py-3">
                    <h6 class="m-0 font-weight-bold text-white">搜索出来的货物</h6>
                </div>
                <div class="card-body">
                    <div class="table-responsive">
                        <table class="table table-striped table-hover">
                            <thead class="thead-light">
                            <tr>
                                <th><i class="fas fa-hashtag mr-1"></i>编号</th>
                                <th><i class="fas fa-user mr-1"></i>货物类别</th>
                                <th><i class="fas fa-venus-mars mr-1"></i>数量</th>
                                <th><i class="fas fa-cog mr-1"></i>操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            <tr th:each="shop:${shopList}">
                                <td th:text="${shop.id}"></td>
                                <td th:text="${shop.type}"></td>
                                <td th:text="${shop.number}"></td>
                                <td>
                                    <a class="btn btn-edit text-white action-btn" href="#" th:href="@{/toShopUpdatePage/}+${shop.id}" title="编辑">
                                        <i class="fas fa-edit"></i>
                                    </a>
                                    <a class="btn btn-delete text-white action-btn" href="#" th:href="@{/deleteShop/}+${shop.id}" title="删除" onclick="return confirm('确定要删除此用户吗？')">
                                        <i class="fas fa-trash-alt"></i>
                                    </a>
                                </td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </main>
    </div>
</div>

<!-- Bootstrap core JavaScript -->
<script type="text/javascript" src="js/jquery-3.2.1.slim.min.js" th:src="@{/js/jquery-3.2.1.slim.min.js}"></script>
<script type="text/javascript" src="js/popper.min.js" th:src="@{/js/popper.min.js}"></script>
<script type="text/javascript" src="js/bootstrap.min.js" th:src="@{/js/bootstrap.min.js}"></script>

<!-- Icons -->
<script type="text/javascript" src="js/feather.min.js" th:src="@{/js/feather.min.js}"></script>
<script>
    feather.replace()
</script>

<!-- Custom scripts -->
<script>
    $(document).ready(function() {
        // 启用工具提示
        $('[title]').tooltip();

        // 表格行点击效果
        $('.table-hover tbody tr').click(function(e) {
            // 排除点击操作按钮的情况
            if (!$(e.target).closest('td:last-child').length) {
                window.location = $(this).find('a.btn-view').attr('href');
            }
        }).css('cursor', 'pointer');
    });
</script>

</body>
</html>